package com.ihr360.payroll.service.staff;


import com.ihr360.commons.vo.PageData;
import com.ihr360.commons.vo.ResultInfo;
import com.ihr360.payroll.entity.staff.StaffPayrollInfoJournalEntity;
import com.ihr360.payroll.model.dto.staff.StaffPayrollInfoJournal;
import com.ihr360.payroll.request.StaffPayrollInfoJournalRequest;
import com.ihr360.payroll.response.StaffPayrollInfoTimelineResponse;
import com.ihr360.payroll.type.SalaryProfileChangeType;
import com.ihr360.rest.service.SimpleRestService;

import java.util.List;
import java.util.Set;

public interface StaffPayrollInfoJournalService extends SimpleRestService<StaffPayrollInfoJournal, Long> {

    /**
     * 今天之后生效的Journal
     * @param staffIds
     * @return
     */
    List<StaffPayrollInfoJournal> findEffectiveAfterTodayJournals(Set<String> staffIds);



    /**
     * 获取员工某薪资档案字段的前后修改记录
     * @param staffId
     * @param code　fieldCode
     * @param changeType
     * @return　value 当前生效值
     */
    StaffPayrollInfoTimelineResponse getPayrollInfoNearestTimes(String staffId, String code, String value, SalaryProfileChangeType changeType);

    /**
     * 分页查询所有日志记录
     * @return
     * @param pageable
     * @param startEffectiveAt
     * @param endEffectiveAt
     * @param fuzzyParam
     */
    PageData<StaffPayrollInfoJournalEntity> findAllJournals(StaffPayrollInfoJournalRequest payrollInfoJournalRequest);

    /**
     * 获取某员工的所有修改日期
     * @param staffId
     * @return
     */
    List<StaffPayrollInfoJournalEntity> getStaffJournalDetail(String staffId);

    ResultInfo save(List<StaffPayrollInfoJournalEntity> journalToSave);
}
